<?php
/**
 *缺货需求(A需求)模型
 *@author shipanpan
 */
class Application_Model_StockoutStory extends Model_Base {
	//符合以下属性的产品不产生缺货需求
	protected $_forbidProductGrade = [3 => '停滞', 4 => '违禁品', 7 => '清仓产品'];
	protected $_forbidProductCatalog = [771 => '清仓清库存专区', 1846 => '侵权产品', 2013 => '海关限制类产品', 2028 => '停滞产品类'];
	protected $_forbidProductResourceStatus = [3 => "停产"];

	public function __construct() {
		$this->db = $this->db();
	}

	public function isForbidProductGrade(int $productGradeId) {
		return in_array($productGradeId, array_keys($this->_forbidProductGrade));
	}

	/**
	 * [isForbidProductCatalog description]
	 * @param  int     $productCatalog [description]
	 * @return boolean                   [description]
	 */
	public function isForbidProductCatalog(int $productCatalog) {
		return in_array($productCatalog, array_keys($this->_forbidProductCatalog));
	}

	/**
	 * [isForbidProductResourceStatus description]
	 * @param  int     $resourceStatus [description]
	 * @return boolean                 [description]
	 */
	public function isForbidProductResourceStatus(int $resourceStatus) {
		return in_array($resourceStatus, array_keys($this->_forbidProductResourceStatus));
	}
}